// *******************************************
// Table B2: Sample distribution cross sectors
// *******************************************

use "$outpath/database_for_reg.dta", clear

eststo clear

xi: reghdfe Lnland_pwc Lnpopcma Lnareacma dist_min_NEW i.cat0 spacematep spacematep2 spacematep3 spacematep4 Lnemp i.hoffice i.exports NBdiffbusiness NBdiffnaics4 NBdiffproduct Lndist_maj_air Lndist_maj_sea Lndist_stat_freight Lndist_junction if samplep==1, absorb(naics4d eruid) cluster(cmauid)

gen insample= e(sample)==1

tab naics3d if insample==1

use "$outpath/database_for_desc.dta", clear

keep if year==2017 & manuf==1

tab naics3d
